﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YdWorkFlow.Core.Model
{
    /// <summary>
    /// 流程定义模板 Add by sgy 2016-03-01
    /// </summary>
    public sealed class WorkflowDefinition : BaseDefinition
    {
        #region 属性定义
        /// <summary>
        /// 流程类型：0 常规流程 1 自由流程
        /// </summary>
        public int FlowType { get; set; }
        /// <summary>
        /// 第一步ID
        /// </summary>
        public Guid FirstStepID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUser { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Note { get; set; }
        /// <summary>
        /// 允许的人员和角色
        /// </summary>
        public List<ActorDefinition> Actors { get; set; }
        /// <summary>
        /// 传入的参数
        /// </summary>
        public List<ParameterDefinition> Parameters { get; set; }
        /// <summary>
        /// 流程节点
        /// </summary>
        public List<ActivityDefinition> Activities { get; set; }
        /// <summary>
        /// 流程连线
        /// </summary>
        public List<TransitionDefinition> Transitions { get; set; }
        #endregion

        public WorkflowDefinition()
        {
            Actors = new List<ActorDefinition>();
            Parameters = new List<ParameterDefinition>();
            Activities = new List<ActivityDefinition>();
            Transitions = new List<TransitionDefinition>();
        }

        /// <summary>
        /// 返回序列化的xml todo
        /// </summary>
        /// <returns></returns>
        public string Serialize()
        {
            return null;
        }
    }
}
